<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <style>
        div {width:200px;height:40px;margin:5px;}
        .d1 {background:#ffe0b2;}
        .d1.d2 {background:#e1bee7;}
        #d3 {background:#ffcdd2;}
        div[ab="d4"] {background:#c8e6c9;}
    </style>
</head>
<body>
    <div>1</div>
    <div class="d1">1</div>
    <div class="d1 d2">2</div>
    <div id="d3">3</div>
    <div ab="d4">4</div>
</body>
</html>